package com.ctfo.ulcp.exp;

import com.ctfo.ulcp.exp.server.CodeExecServer;
import com.ctfo.ulcp.exp.server.ServiceServer;
import io.vertx.core.DeploymentOptions;
import io.vertx.core.Vertx;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class Application {

    public static void main(String[] args) {
        Vertx vertx = Vertx.vertx();

        vertx.deployVerticle(ServiceServer::new, new DeploymentOptions().setInstances(1)).onComplete(r -> {
            if (r.succeeded()) {
                log.info("deploy service server success");
            } else {
                log.error("deploy service server error", r.cause());
            }
        });

        vertx.deployVerticle(CodeExecServer::new, new DeploymentOptions()).onComplete(r -> {
            if (r.succeeded()) {
                log.info("deploy exec server success");
            } else {
                log.error("deploy exec server error", r.cause());
            }
        });


    }
}
